import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import { createPinia } from "pinia";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css"; // 关键：导入 Element Plus 样式
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

const app = createApp(App);

// 注册图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(createPinia());
app.use(router);
app.use(ElementPlus);

// 暴露全局变量给微应用
// const globalWindow: any = window;
// globalWindow.Vue = app.config.globalProperties.constructor;
// globalWindow.ElementPlus = ElementPlus;
// globalWindow.Pinia = app.config.globalProperties.$pinia;
// globalWindow.VueRouter = router;

app.mount("#app");
